import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/wapi': {
        target: 'https://www.zhipin.com',
        changeOrigin: true,
        headers: {
          'Referer': 'https://www.zhipin.com/web/geek/job?query=%E5%89%8D%E7%AB%AF&city=101110100',
          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
          'X-Requested-With': 'XMLHttpRequest',
          'Sec-Fetch-Mode': 'cors',
          'Sec-Fetch-Site': 'same-origin',
          // 替换下面的 Cookie
          'Cookie': `__g=-; __l=l=%2Fwww.zhipin.com%2Fweb%2Fgeek%2Fjob%3Fquery%3D%25E5%2589%258D%25E7%25AB%25AF%26city%3D101110100&r=&g=&s=3&friend_source=0; wd_guid=b174d4a0-7e92-4355-8d98-60e4bc1030e9; historyState=state; _bl_uid=pLltmieqva84w3jL82tjuhb3pI76; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1686711589; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1686711589; __zp_stoken__=b073eaTxSa2RxSG8nYzdtLRIJTg9qWEEoe2F3UzMuNycDQhoLcBUkbVc7MmJ%2FSWtSPF02dVIcZHJ3JXUYIgdnbRMfMA0tIlYSJzhPVxBzE18FOllNNzUMSlY9S0BYGUEyfmQEDiB9TwVpYXQ%3D; __c=1686711588; __a=82613825.1686711588..1686711588.4.1.4.4`
        },
      }
    }
  }
})
